package cn.topevery.garden.dal.logic;

import cn.topevery.garden.dal.dao.FundManagementDao;
import cn.topevery.garden.entity.po.FundManagement;
import cn.topevery.garden.entity.query.FundManagementQuery;
import cn.topevery.garden.entity.vo.FundManagementVO;
import cn.topevery.garden.framework.base.BaseLogic;
import hw.topevery.framework.db.base.BaseEntityDao;
import hw.topevery.framework.db.entity.DataPager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 养护资金管理
 *
 * @author code-generate
 * @date 2022-02-19
 */
@Service
public class FundManagementLogic extends BaseLogic<FundManagement> {
    @Autowired
    FundManagementDao fundManagementDao;

    @Override
    public BaseEntityDao<FundManagement, Integer> getDao() {
        return fundManagementDao;
    }

    

    /**
     * 获取列表
     *
     * @param query
     */
    public DataPager<FundManagementVO> listPage(FundManagementQuery query) {
        return fundManagementDao.listPage(query);
    }

    /**
     * 根据自增id批量删除
     *
     * @param ids
     */
    public void deleteBatchById(String userId,Integer[] ids) {
        fundManagementDao.delete(userId, ids);
    }

    /**
     * 根据自增id保存或者更新
     *
     * @param fundManagement 实体
     */
    public void saveOrUpdate(String userId, FundManagement fundManagement){
        fundManagementDao.saveOrUpdate(userId,fundManagement);
    }

    /**
         * 根据自定义列值来获取对象
         */
    public FundManagement getEntityByColumn(String key, String value) {
        return fundManagementDao.getEntityByColumn(key, value);
    }
}
